# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=ktimetracker
pkgver=5.0.1
pkgrel=1
arch="all !armhf" #qtdeclarative
url="https://kde.org/applications/office/org.kde.ktimetracker"
pkgdesc="Todo management and time tracker"
license="GPL-2.0-or-later AND GFDL-1.2-only"
makedepends="extra-cmake-modules qt5-qtbase-dev kconfig-dev kconfigwidgets-dev kdbusaddons-dev kdoctools-dev ki18n-dev kidletime-dev kjobwidgets-dev kio-dev knotifications-dev kwindowsystem-dev kxmlgui-dev ktextwidgets kcalendarcore-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/ktimetracker/$pkgver/src/ktimetracker-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	case "$CARCH" in
		armv7|x86) excluded_tests="(formattime|exportcsv)test" ;;
		*) excluded_tests="" ;;
	esac

	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "($excluded_tests)"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="78de8651efd72fa9fd5c7f06992ab8970e1d763c6f30f5eba52ec93bb6a2bb19ae777bc90809ef5198bc3b6a5f9f5ee78e240eadcacd8ce8489bdb28cd62431e  ktimetracker-5.0.1.tar.xz"
